<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditEncomendaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditEncomendaLabel_idEncomenda}" for="idEncomenda" />
                    <h:inputText id="idEncomenda" value="#{encomendaController.selected.idEncomenda}" title="#{bundle.EditEncomendaTitle_idEncomenda}" required="true" requiredMessage="#{bundle.EditEncomendaRequiredMessage_idEncomenda}"/>
                    <h:outputLabel value="#{bundle.EditEncomendaLabel_recebeu}" for="recebeu" />
                    <h:inputText id="recebeu" value="#{encomendaController.selected.recebeu}" title="#{bundle.EditEncomendaTitle_recebeu}" required="true" requiredMessage="#{bundle.EditEncomendaRequiredMessage_recebeu}"/>
                    <h:outputLabel value="#{bundle.EditEncomendaLabel_estado}" for="estado" />
                    <h:inputText id="estado" value="#{encomendaController.selected.estado}" title="#{bundle.EditEncomendaTitle_estado}" required="true" requiredMessage="#{bundle.EditEncomendaRequiredMessage_estado}"/>
                    <h:outputLabel value="#{bundle.EditEncomendaLabel_fkFuncionario}" for="fkFuncionario" />
                    <h:selectOneMenu id="fkFuncionario" value="#{encomendaController.selected.fkFuncionario}" title="#{bundle.EditEncomendaTitle_fkFuncionario}" required="true" requiredMessage="#{bundle.EditEncomendaRequiredMessage_fkFuncionario}">
                        <f:selectItems value="#{funcionarioController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditEncomendaLabel_fkidFornecedor}" for="fkidFornecedor" />
                    <h:selectOneMenu id="fkidFornecedor" value="#{encomendaController.selected.fkidFornecedor}" title="#{bundle.EditEncomendaTitle_fkidFornecedor}" required="true" requiredMessage="#{bundle.EditEncomendaRequiredMessage_fkidFornecedor}">
                        <f:selectItems value="#{fornecedorController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditEncomendaLabel_data}" for="data" />
                    <h:inputText id="data" value="#{encomendaController.selected.data}" title="#{bundle.EditEncomendaTitle_data}" required="true" requiredMessage="#{bundle.EditEncomendaRequiredMessage_data}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditEncomendaLabel_hora}" for="hora" />
                    <h:inputText id="hora" value="#{encomendaController.selected.hora}" title="#{bundle.EditEncomendaTitle_hora}" required="true" requiredMessage="#{bundle.EditEncomendaRequiredMessage_hora}">
                        <f:convertDateTime pattern="HH:mm:ss" />
                    </h:inputText>
                </h:panelGrid>
                <h:commandLink action="#{encomendaController.update}" value="#{bundle.EditEncomendaSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditEncomendaViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{encomendaController.prepareList}" value="#{bundle.EditEncomendaShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditEncomendaIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
